﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DigiLib;
using BusinessObjects.BO_GetObjects;
using System.Data.SqlTypes;

public partial class Administrator_Controls_ServeyAdd : System.Web.UI.UserControl {
    protected void Page_Load(object sender, EventArgs e) {
    }
    protected void btnSubmit_Click(object sender, EventArgs e) {
        try {
            BO_portal_survey.Insert(txtTitle.Text.Trim()
                , txtDescription.Text.Trim()
                , 0
                , 0
                , SqlUtils.GetNextOrderDisplay("portal_servey")
                , DateTime.Now
                , Administrator.USER_NAME
                , SqlDateTime.Null
                , string.Empty
                , true);

            divMessage.InnerHtml = MessageBox.Success("Thông báo", "Thêm Servey thành công!");
        } catch (Exception ex) {
            divMessage.InnerHtml = MessageBox.Error("Lỗi", "Phát hiện lỗi như sau: " + ex.Message);
        }
    }
}